package com.qulai;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;

/**
 * 启动程序
 * 
 * @author hunan
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@EnableTransactionManagement // 启用事务管理
public class HunanApplication
{
    private static final Logger logger = LoggerFactory.getLogger(HunanApplication.class);

    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(HunanApplication.class, args);
        logger.info("！！！！！！！！！！！！！启动成功！！！！！！！！！！！！！！");
    }

    @PostConstruct
    public void checkLoggingConfiguration() {
        logger.info("========== 日志系统初始化检查 ==========");
        logger.info("此消息应出现在控制台和日志文件中");
        logger.info("如果只出现在控制台，说明日志文件配置有问题");
        logger.info("日志文件路径: ./logs/all-logs.log");
        logger.info("=====================================");
    }
}
